#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>


int main()
{
    umask(0);
    int fd = open("myfiel", O_WRONLY|O_CREAT );
    if(fd < 0){
        perror("open");
        return 1;
    }
    const char* str = "this is a file\n";
    int len = strlen(str);
    int count = 5;
    while(count--){
        write(fd, str, len);
    }
    close(fd);
    return 0;
}